package com.usian.controller;

import com.usian.feign.CotnentServiceFeign;
import com.usian.utils.AdNode;
import com.usian.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 韩耀东
 * @date 2021/1/13 10:03
 */
@RestController
@RequestMapping("/frontend/content")
public class ContentController {

    @Autowired
    private CotnentServiceFeign cotnentServiceFeign;

    /**
     * @Author 韩耀东
     * @Description //TODO 首页大广告位接口
     * @Date 2021/1/13 10:06
     * @Param []
     * @return com.usian.utils.Result
     **/
    @RequestMapping("/selectFrontendContentByAD")
    public Result selectFrontendContentByAD(){
        List<AdNode> nodeList = cotnentServiceFeign.selectFrontendContentByAD();
        if (nodeList.size()>0 && nodeList != null){
            return Result.ok(nodeList);
        }
        return Result.error("查询失败");
    }


}
